#include "../include/Element.hpp"
#include <iostream>
#include "../utils/load_region.hpp"
#include "../../input/parameters.hpp"

int main()
{
    Point p1(0, {0.0, 0.0}, 0);
    Point p2(1, {1.0, 0.0}, 0);
    Point p3(2, {0.5, 0.5}, 0);
    Region r = load_region();
    std::cout << "create points successfully!" << std::endl;
    Element e1(0, {p1, p2, p3}, 0);    
    std::cout << "create elements successfully!" << std::endl;
    std::cout << "Jacobi(e1)=" << Jacobi(e1) << std::endl;
    std::function<double(double, double)> f = [](double x, double y)
    {
        return (x+y)*(x-y);
    };
    double rst = e1.integral(f,r);
    std::cout << "integral ∫x^2-y^2dxdy="<< rst << std::endl;
    return 0;
}
